<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<% String path=request.getContextPath(); String basePath=request.getScheme()+ "://" + request.getServerName() + ":" + request.getServerPort() + path+ "/"; %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >
<html  xmlns="http://www.w3.org/1999/xhtml"> 
<head>
<base href="<%=basePath%>">
<title>出库缴费</title>
<%@ include file="/WEB-INF/jsp/common/common.jsp" %>
<script src="js/jquery.divbox.js" type="text/javascript"></script>
	<style  media="print" type="text/css">  
		.noprint{visibility:hidden}  
	</style>
	<style>
		.input_button_1,
		.input_button_2{
			margin-right: 10px;
		}
		.h_30 {
			height: 30px;
			line-height: 30px;
		}
	</style>
	<script type="text/javascript">
	/*----------- 初始化 ------------------- */
	function init() {
		queryChannelInfo('1')
	}
	$(function() {
		init()
	})
	/*----------- 初始化 ------------------- */
	/* 查询卡出库记录*/
	function queryChannelInfo(displayPage){
		var name= $("#name").val();
		var operatorName= $("#operatorName").val();
		var agentMan= $("#agentMan").val();
		var startDate= $("#startDate").val();
		var endDate= $("#endDate").val();
		var isPay= $("#isPay").val();
		loadQueryData({current:displayPage,size:10,name: name, operatorName: operatorName, agentMan: agentMan,startDate:startDate,endDate:endDate,isPay:isPay});
	}
	function loadQueryData(param){
		var jsonDate;
		if(null != param && null != param.current){
			jsonDate =param;	
		}else{
			jsonDate={current:1,size:10};
		}
		$.openLoading();
		$.ajax({
			url : "outboundCard/queryCommamtFeeList",
			type : 'POST',
			async : true,
			dataType:'json',
			data:jsonDate,
			success : function(page) {
				$.closeLoading();
				if($.validate(page))return;
				var firstbutton ="<input class='input_fxk' name='radioCard' type='radio' value='#'>";
				var fieldNames = "commamtId,name,pricelessType?[{0:'有价'};{1:'非有价'}],status?[{0:'未收付'};{1:'已收付'};{2:'出库取消'}],backPayFlag?[{0:'未回传'};{1:'处理中'};{2:'成功'};{3:'失败'}],handleTotal,modalPremAmtStr,totPremAMtStr,agentFeeStr,totAgentFeeStr,agentPremRateStr,operator,operatorDeptNo,operatorName,agentMan,agentProtocolNo,cchannleCode,cchannleType,cchaLevel,operatorDateStr,cardDefineId@TDH,status@TDH,pricelessType@TDH,backPayFlag@TDH";
				var tableContent = creatTable1(fieldNames, page, firstbutton, null);
				var tableObj = $("#cardInfoTable");
				tableObj.find("tbody").remove();
				tableObj.append(tableContent);
				
				var strPage = creatChannelPage(page.current,6,page.maxPage,"1");
				var pageDIV = $("#txCardpageDIV");
				pageDIV[0].innerHTML="";
				pageDIV.append(strPage);
				bindradio()// 绑定单选
			}
		})
	}
	
	//查看出库记录明细
	function queryAgentInfo4(current){
		var radioCard = $("input[name='radioCard']:checked");
		if(radioCard.val()!=undefined){
			var flagIsPrice=23;
			var flagIsPay=22;
			var isPrice = radioCard.parent().parent().children(" td:eq("+flagIsPrice+")").html();
			var isPay = radioCard.parent().parent().children(" td:eq("+flagIsPay+")").html();
			if(isPrice=="0" && isPay=="2"){
				$.message("error", "已撤销出库申请，还未出库！");
				return;
			}else{
				var flag=1;
				var flagCount=6;
				var flagcardDefineId=21;
				var commamtId = radioCard.parent().parent().children(" td:eq("+flag+")").html();
				var count = radioCard.parent().parent().children(" td:eq("+flagCount+")").html();
				var cardDefineId = radioCard.parent().parent().children(" td:eq("+flagcardDefineId+")").html();
				var jsonDate={current:current,size:10,commamtId:commamtId,count:count,cardDefineId:cardDefineId};
				$.openLoading();
				$.ajax({
					url : "outboundCard/queryCardInfoByCommamtId?"+new Date().getTime(),
					type : 'POST',
					async : true,
					dataType:'json',
					data:jsonDate,
					success : function(page) {
						$.closeLoading();
						if($.validate(page))return;
						if(page.data==null){
							$.message("error","查询失败");
							return ;
						}
						var str = ''
						$.each(page.data, function (i, name, cardNo, status) {
							str += '<tr><td>' + ((i + 1)+(parseInt(page.current)-1)*(parseInt(page.size))) + '</td><td>' + page.data[i].name + '</td><td>' + page.data[i].cardNo + '</td><td>';
							if(page.data[i].status=='0'){
								str +='库存'+'</td></tr>';
							}else if(page.data[i].status=='1'){
								str +='上交'+'</td></tr>';
							}else if(page.data[i].status=='2'){
								str +='下发'+'</td></tr>';
							}else if(page.data[i].status=='3'){
								str +='关联销售信息'+'</td></tr>';
							}else if(page.data[i].status=='4'){
								str +='已缴费/可激活'+'</td></tr>';
							}else if(page.data[i].status=='5'){
								str +='已激活'+'</td></tr>';
							}else if(page.data[i].status=='6'){
								str +='作废'+'</td></tr>';
							}else if(page.data[i].status=='7'){
								str +='锁定'+'</td></tr>';
							}else if(page.data[i].status=='9'){
                                str +='过期'+'</td></tr>';
                            }
							//console.log(str);
						});
						var tableObj = $("#agentInfo4Table tbody");
						tableObj.html(str);
						//var fieldNames = "{name:'number','data': null,'targets': 0 },name,cardNo,status?[{0:'库存'};{1:'上交'};{2:'下发'};{3:'关联销售信息'};{4:'可激活'};{5:'已激活'};{6:'已作废'};{7:'已锁定'}]";
						//var tableContent = creatTable4(fieldNames,page,null,null);
						//var tableObj = $("#agentInfo4Table");
						//tableObj.find("tbody").remove();
						//tableObj.append(tableContent);
						
						var strPage = creatChannelPage4(jsonDate.current,6,page.maxPage,"48");
						var pageDIV = $("#agentInfo4Page");
						pageDIV[0].innerHTML="";
						pageDIV.append(strPage);
						
						$('#agentInfo4Div').OpenDiv();
						
						// bindradio();
					}
				});
			}
		}else{
			$.message("error", "请选择一条记录");
		}		
	}
	
	//缴费确认
	function paymentConfirm(){
		var radioCard = $("input[name='radioCard']:checked");
		if(radioCard.val()!=undefined){
			var flag=1;
			var flagIsPay=22;
			var flagType=23;
			var commamtId = radioCard.parent().parent().children(" td:eq("+flag+")").html();
			var isPay = radioCard.parent().parent().children(" td:eq("+flagIsPay+")").html();
			var type = radioCard.parent().parent().children(" td:eq("+flagType+")").html();
			var jsonDate={commamtId:commamtId,isPay:isPay};
			if(type=="1"){
				$.message("error", "此卡为非有价激活卡，不需要缴费确认！");
				return;
			}else if(type=="0" && isPay=="1"){
				$.message("error", "您已缴费完成！");
				return;
			}else if(type=="0" && isPay=="2"){
				$.message("error", "您已撤销出库申请，不可以缴费！");
				return;
			}else if(type=="0" && isPay=="0"){
/* 				$.ajax({
					url : "outboundCard/doConfirm?"+new Date().getTime(),
					type : 'POST',
					async : true,
					dataType:'json',
					data:jsonDate,
					success : function(result) {
						$.closeLoading();
						if("success"==result.result&&""!=result.message){
							$.message("success", result.message);
							queryChannelInfo('1');//重新查询当前页面
				    	}
						if("fail"==result.result){
				    		$.message("error", "系统错误,请联系管理员");
				    	}
						if("error"==result.result&&""!=result.message){
				    		$.message("error", result.message);
				    	}
					}
				}); */
				// 集中收款平台对接 2019/03/12 zhouxx start
				//window.open("<%=path%>/outboundCard/cardPay?commamtId="+commamtId)
				window.open("<%=path%>/outbound/cardNewPay?commamtId="+commamtId)
				// 集中收款平台对接 2019/03/12 zhouxx end
				$.dialog2({
					width: 400,
					top:40,
					title: "支付提示",
					ok:"支付取消",
					cancel:"支付完成",
					content: "<div style='margin:20px'>支付完成前，请不要关闭此窗口。为了您的激活卡及时生效，请在失效日期之前完成支付，支付完成点击以下按钮继续操作</div>",
					onClose:function(){
						
					},
					onCancel:function(){
						queryChannelInfo($('.page_a_click').html())
					},
					onOk: function() {
						queryChannelInfo($('.page_a_click').html())
					}
				});
			}
		}else{
			$.message("error", "请选择一条记录");
		}		
	}
	
	//撤销出库
	function cancelOutboundApply(){
		var radioCard = $("input[name='radioCard']:checked");
		if(radioCard.val()!=undefined){
			var flag=1;
			var flagIsPay=22;
			var flagType=23;
			var commamtId = radioCard.parent().parent().children(" td:eq("+1+")").html();
			var isPay = radioCard.parent().parent().children(" td:eq("+flagIsPay+")").html();
			var type = radioCard.parent().parent().children(" td:eq("+flagType+")").html();
			var jsonDate={commamtId:commamtId,isPay:isPay};
			if(type=="1"){
				$.message("error", "该单已出库完成，很抱歉不允许撤销！");
				return;
			}else if(type=="0" && isPay=="1"){
				$.message("error", "您已缴费完成，不能撤销出库！");
				return;
			}else if(type=="0" && isPay=="2"){
				$.message("error", "您已撤销出库！");
				return;
			}else if(type=="0" && isPay=="0"){
				$.dialog({
		            type: "warn",
		            content: "您确定要撤销出库吗？",
		            onOk: function() {
		                doCancle(jsonDate);
		            }
		        });
			}
		}else{
			$.message("error", "请选择一条记录");
		}		
	}
	
	function doCancle(jsonDate){
        $.openLoading();
        $.ajax({
            url : "outboundCard/doCancel?"+new Date().getTime(),
            type : 'POST',
            async : true,
            dataType:'json',
            data:jsonDate,
            success : function(result) {
                $.closeLoading();
                if("success"==result.result&&""!=result.message){
                    $.message("success", result.message);
                    queryChannelInfo($('.page_a_click').html());//重新查询当前页面
                }
                if("fail"==result.result){
                    $.message("error", "系统错误,请联系管理员");
                }
                if("error"==result.result&&""!=result.message){
                    $.message("error", result.message);
                }
            }
        });
	}
	
	//回传收付
    function backPay(){
        var radioCard = $("input[name='radioCard']:checked");
        if(radioCard.val()!=undefined){
            var flag=1;
            var flagBackPayFlag=24;
            var flagIsPay=22;
            var flagType=23;
            var commamtId = radioCard.parent().parent().children(" td:eq("+1+")").html();
            var backPayFlag = radioCard.parent().parent().children(" td:eq("+flagBackPayFlag+")").html();
            var isPay = radioCard.parent().parent().children(" td:eq("+flagIsPay+")").html();
            var type = radioCard.parent().parent().children(" td:eq("+flagType+")").html();
            var jsonDate={commamtId:commamtId};
            if(type=="1"){
                $.message("error", "非有价激活卡不需要缴费，更不需要回传缴费信息到收付");
                return;
            }else if(type=="0" && isPay=="0"){
                $.message("error", "还未缴费，没有缴费信息回传收付");
            }else if(type=="0" && isPay=="1" &&backPayFlag=="1"){
                $.message("error", "回传收付处理中，请稍后重新查询");
                return;
            }else if(type=="0" && isPay=="1" &&backPayFlag=="2"){
                $.message("error", "回传收付已完成");
                return;
            }else if(type=="0" && isPay=="2"){
                $.message("error", "您已撤销出库，没有缴费信息回传收付");
                return;
            }else if(type=="0" && isPay=="1" &&(backPayFlag=="0"||backPayFlag=="3")){
            	$.openLoading();
                $.ajax({
                    url : "outboundCard/backPay",
                    type : 'POST',
                    async : true,
                    dataType:'json',
                    data:jsonDate,
                    success : function(result) {
                        $.closeLoading();
                        if("success"==result.result&&""!=result.message){
                            $.message("success", result.message);
                            queryChannelInfo($('.page_a_click').html());//重新查询当前页面
                        }
                        if("fail"==result.result){
                            $.message("error", "系统错误,请联系管理员");
                            queryChannelInfo($('.page_a_click').html());//重新查询当前页面
                        }
                        if("error"==result.result&&""!=result.message){
                            $.message("error", result.message);
                            queryChannelInfo($('.page_a_click').html());//重新查询当前页面
                        }
                    }
                });
            }else{
            	$.message("error", "不能回传收付");
            }
        }else{
            $.message("error", "请选择一条记录");
        }       
    }
	//打印手续费
	function printAgentFee(){
		var radioCard = $("input[name='radioCard']:checked");
		if(radioCard.val()!=undefined){
			$(".dynamicTr").remove();
			var flag=1;
			var flagType=23;
			var commamtId = radioCard.parent().parent().children(" td:eq("+1+")").html();
			var type = radioCard.parent().parent().children(" td:eq("+flagType+")").html();
			var jsonDate = {commamtId:commamtId,type:"1"};
			if(type=="1"){
				$.message("error", "不需要预收，不可打印手续费！");
				return;
			}else if(type=="0"){
				$.ajax({
					url : "outboundCard/getPremamtAndAgentFee",
					type : 'POST',
					async : true,
					dataType:'json',
					data:jsonDate,
					success : function(result) {
						$.closeLoading();
						if("success"==result.result&&""!=result.message){
                            var card_list=result.data.cardNoList;
                            if(card_list != null){
                                var trHtml;
                                $("#commamtIdSpan1").html(result.data.commamtId);
	                            for(var i = 0; i < card_list.length; i++){
	                            	var $tr=$("#tableFee"+" tr").eq(i);
	                            	trHtml="<tr style='height:18px;' class='dynamicTr'><td style='text-align:center;border:1px solid black;'>"+card_list[i].cardNo+"</td>"
		                         	   +"<td style='text-align:center;border:1px solid black;'>"+card_list[i].name+"</td>"
		                        	   +"<td style='text-align:center;border:1px solid black;'>"+card_list[i].handleTotal+"</td>"
		                        	   +"<td style='text-align:center;border:1px solid black;'>￥"+card_list[i].modalPremAmt+"</td>"
		                        	   +"<td style='text-align:center;border:1px solid black;'>￥"+card_list[i].agentFee+"</td>"
		                        	   +"<td style='text-align:center;border:1px solid black;'>￥"+card_list[i].totAgentFee+"</td></tr>"
	                                $tr.after(trHtml);
	                            }
	                        	$("#dxTotAgentFeeSpan1").html(changeNumMoneyToChinese(result.data.totAgentFee));
	                            $("#xx2TotAgentFeeSpan1").html(fmoney(result.data.totAgentFee));
	                            if(result.data.operatorNo!=null && result.data.operatorNo!=''){
	                                $("#operatorNameSpan1").html(result.data.operatorName+"("+result.data.operatorNo+")");
	                            }
	                            if(result.data.agentNo!=null && result.data.agentNo!=''){
	                                $("#agentManSpan1").html(result.data.agentMan+"("+result.data.agentNo+")");
	                            }
	                            $("#operatorDeptNoSpan1").html(result.data.operatorDeptNo);
	                            $("#operatorSpan1").html(result.data.operator);
	                            $("#printDateSpan1").html(result.data.printDate);
								$("#printFeeDiv").OpenDiv();
                            }else{
                            	$.message("error", "出库申请的卡已全部退卡，不可打印！");
                            }
				   		}
						if("fail"==result.result){
				    		$.message("error", "系统错误,请联系管理员");
				    	}
						if("error"==result.result&&""!=result.message){
				    		$.message("error", result.message);
				    	}
					}
				});
			}
		}else{
			$.message("error", "请选择一条记录");
		}		
	}
	function print(divId,noprint){

        //printDivCSS = new String ('<link href="myprintstyle.css" rel="stylesheet" type="text/css">')
        if (!!window.ActiveXObject || "ActiveXObject" in window) {
            remove_ie_header_and_footer();
        }
        $("#"+noprint).css("display","none"); 
		window.frames["print_frame"].document.body.innerHTML=document.getElementById(divId).innerHTML;
        window.frames["print_frame"].window.focus();
        window.frames["print_frame"].window.print();
        $("#"+noprint).css("display","");  
        return false; 
	}
	function remove_ie_header_and_footer() {
	    var hkey_root, hkey_path, hkey_key;
	    hkey_path = "HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
	    try {
	        var RegWsh = new ActiveXObject("WScript.Shell");
	        RegWsh.RegWrite(hkey_path + "header", "");
	        RegWsh.RegWrite(hkey_path + "footer", "");
	    } catch (e) {}
	}
	
	//打印保费
	function printPremamt(){
		var radioCard = $("input[name='radioCard']:checked");
		if(radioCard.val()!=undefined){
			$(".dynamicTr").remove();
			var flag=1;
			var flagIsPay=22;
			var flagType=23;
			var commamtId = radioCard.parent().parent().children(" td:eq("+1+")").html();
			var isPay = radioCard.parent().parent().children(" td:eq("+flagIsPay+")").html();
			var type = radioCard.parent().parent().children(" td:eq("+flagType+")").html();
			var jsonDate = {commamtId:commamtId,type:"0"};
			if(type=="1"){
				$.message("error", "不需要预收，不可打印保费！");
				return;
			}else if(type=="0"){
				$.ajax({
					url : "outboundCard/getPremamtAndAgentFee",
					type : 'POST',
					async : true,
					dataType:'json',
					data:jsonDate,
					success : function(result) {
						$.closeLoading();
						if("success"==result.result&&""!=result.message){
                            var card_list=result.data.cardNoList;
							if(card_list!=null){
	                            $("#commamtIdSpan").html(result.data.commamtId);
	                            $("#preSellNoSpan").html(result.data.preSellNo);
	                            var trHtml;
	                            for(var i = 0; i < card_list.length; i++){
	                            	var $tr=$("#tablePremamt"+" tr").eq(i);
	                            	trHtml="<tr style='height:18px;' class='dynamicTr'><td style='text-align:center;border:1px solid black;'>"+card_list[i].cardNo+"</td>"
		                         	   +"<td style='text-align:center;border:1px solid black;'>"+card_list[i].name+"</td>"
		                        	   +"<td style='text-align:center;border:1px solid black;'>"+card_list[i].handleTotal+"</td>"
		                        	   +"<td style='text-align:center;border:1px solid black;'>￥"+card_list[i].modalPremAmt+"</td>"
		                        	   +"<td style='text-align:center;border:1px solid black;'>￥"+card_list[i].totPremAMt+"</td></tr>"
	                                $tr.after(trHtml);
	                            }
	                        	$("#dxTotPremAMtSpan").html(changeNumMoneyToChinese(result.data.totPremAMt));
	                            $("#xx2TotPremAMtSpan").html(fmoney(result.data.totPremAMt));
	                            if(result.data.operatorNo!=null && result.data.operatorNo!=''){
	                                $("#operatorNameSpan").html(result.data.operatorName+"("+result.data.operatorNo+")");
	                            }
	                            if(result.data.agentNo!=null && result.data.agentNo!=''){
	                                $("#agentManSpan").html(result.data.agentMan+"("+result.data.agentNo+")");
	                            }
	                            $("#operatorDeptNoSpan").html(result.data.operatorDeptNo);
	                            $("#operatorSpan").html(result.data.operator);
	                            $("#printDateSpan").html(result.data.printDate);
								$("#printDiv").OpenDiv();
							}else{
								$.message("error", "出库申请的卡已全部退卡，不可打印！");
							}
				   		}
						if("fail"==result.result){
				    		$.message("error", "系统错误,请联系管理员");
				    	}
						if("error"==result.result&&""!=result.message){
				    		$.message("error", result.message);
				    	}
					}
				});
			}
		}else{
			$.message("error", "请选择一条记录");
		}		
	}
	
	//关闭小窗口
	// 统一 关闭  窗口
	function closeCurrentDIV(obj){
		$("#"+obj).CloseDiv();
	}
	
	function vreset(){
		$("#name").val("");
		$("#operatorName").val("");
		$("#startDate").val("");
		$("#endDate").val("");
		$("#agentMan").val("");
		$("#isPay").val("");
		//$("#type").val("");
	}
	//绑定单选按钮事件，选中某个单选按钮，该按钮所在行高亮显示
	function bindradio(){
		$("input[name='radioCard']").parent().parent().children().click(function(){
			$("input[name='radioCard']").parent().parent().removeClass("table_highlighter");
			$("input[name='radioCard']").attr('checked', false)
			$(this).parent().addClass("table_highlighter");
			$(this).parent().children().children("input[name='radioCard']").attr('checked', true)
	   	});
	}

	/**
	*金额转换为xxx,xxx.00形式
	*/
	function fmoney(s){  
		if(s==undefined||s==null||s==''||isNaN(s)) return "0.00";
	    var strs = Number(s).toFixed(2).split(".");
	    var preStrs = strs[0].split("").reverse();
	    var ss="";
	    for(j=0;j<preStrs.length;j++){
		    ss += preStrs[j] + ((j+1)%3==0&&(j+1)!=preStrs.length?",":"");
	    }
	    return ss.split("").reverse().join("")+"."+strs[1];
	} 
	/**
	*人民币大写转换
	*/
	function changeNumMoneyToChinese(money) {
		var cnNums = new Array("零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"); //汉字的数字
		var cnIntRadice = new Array("", "拾", "佰", "仟"); //基本单位
		var cnIntUnits = new Array("", "万", "亿", "兆"); //对应整数部分扩展单位
		var cnDecUnits = new Array("角", "分", "毫", "厘"); //对应小数部分单位
		var cnInteger = "整"; //整数金额时后面跟的字符
		var cnIntLast = "元"; //整型完以后的单位
		var maxNum = 999999999999999.9999; //最大处理的数字
		var IntegerNum; //金额整数部分
		var DecimalNum; //金额小数部分
		var ChineseStr = ""; //输出的中文金额字符串
		var parts; //分离金额后用的数组，预定义

		if (money === "") {
			return "";
		}
		if (money == 0) {
			ChineseStr = cnNums[0] + cnIntLast + cnInteger;
			return ChineseStr;
		}
		money = parseFloat(money);
			if (money >= maxNum) {
			alert('超出最大处理数字');
			return "";
		}
		money = money.toString(); //转换为字符串
		if (money.indexOf(".") == -1) {
			IntegerNum = money;
			DecimalNum = '';
		} else {
			parts = money.split(".");
			IntegerNum = parts[0];
			DecimalNum = parts[1].substr(0, 4);
		}
		if (parseInt(IntegerNum, 10) > 0) { //获取整型部分转换
			var zeroCount = 0;
			var IntLen = IntegerNum.length;
			for (var i = 0; i < IntLen; i++) {
				var n = IntegerNum.substr(i, 1);
				var p = IntLen - i - 1;
				var q = p / 4;
				var m = p % 4;
				if (n == "0") {
					zeroCount++;
				} else {
					if (zeroCount > 0) {
						ChineseStr += cnNums[0];
					}
					zeroCount = 0; //归零
					ChineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
				}
				if (m == 0 && zeroCount < 4) {
					ChineseStr += cnIntUnits[q];
				}
			}
			ChineseStr += cnIntLast;
			//整型部分处理完毕
		}
		if (DecimalNum != '') { //小数部分
			var decLen = DecimalNum.length;
			for (var i = 0; i < decLen; i++) {
				var n = DecimalNum.substr(i, 1);
				if (n != '0') {
					ChineseStr += cnNums[Number(n)] + cnDecUnits[i];
				}
			}
		}
		if (ChineseStr == '') {
			ChineseStr += cnNums[0] + cnIntLast + cnInteger;
		} else if (DecimalNum == '') {
			ChineseStr += cnInteger;
		}
		return ChineseStr;
	}
	function returnBack(){
		window.location.href = "<%=path%>/outboundCard/outbound";
	}
	</script>
</head>
<body >
	<div class="current">
		<table class="current_table_1">
			<tbody>
				<tr class="f2">
		            <td>
		              <img src="./images/current_1.jpg">
		            </td>
		            <td class="current_table_1_td">
		              <img src="images/current_1.png">&nbsp;您现在的位置：&nbsp;
		                <span style=" color:#136bab; ">激活卡管理
		                	<span style="padding:0 5px; font-weight:bold; line-height:28px;">&gt;</span>
		                	激活卡出库
		                	<span style="padding:0 5px; font-weight:bold; line-height:28px;">&gt;</span>
		                	出库缴费
		            	</span>
		            </td>
		            <td><img src="./images/current_3.jpg"></td>
	        	</tr>
			</tbody>
		</table>
	</div>			
		
	<table class="table_02" id="table">
		<tr>
			<td>
				<table class="search_table">
					<tr class="h_30">
						<td width="20%" height="30">卡定义名称：
							<input name="txt3" id="name" type="text" class="input_text" maxlength="100" value="">
						</td>
						<td width="20%" height="30">业务员&nbsp;：
							<input name="txt3" id="operatorName" type="text" class="input_text" maxlength="30" value="">
						</td>
						<td width="20%" height="30">代理人：
							<input name="txt3" id="agentMan" type="text" class="input_text" maxlength="30" value="">
						</td>
						<td width="20%" height="30">出库日期：
                            <input id="startDate" onkeydown="false" onclick="showCalendar('startDate','y-mm-dd');" readonly="readonly" class="input_time" type="text" />
                        </td>
                        <td width="20%" height="30">至：
                            <input id="endDate" onkeydown="false" onclick="showCalendar('endDate','y-mm-dd');" readonly="readonly" class="input_time" type="text" />
                        </td>
						
					</tr>					
					<tr class="h_30">
						<!-- <td width="23%" height="30">是否预收：
		                  	<select id="isPreFee"  class="select_1" style="visibility: visible;">
		                  		<option value="">----请选择----</option>
		                  		<option value="Y">Y-是</option>
		                  		<option value="N">N-否</option>
		                  	</select>
						</td> -->
						<td width="20%" height="30">状&nbsp;&nbsp;态&nbsp;：
                            <select id="isPay"  class="select_1" style="visibility: visible;">
                                <option value="">----请选择----</option>
                                <option value="0">未收付</option>
                                <option value="1">已收付</option>
                                <option value="2">出库取消</option>
                            </select>
                        </td>
                        
						<!-- 
						<td width="23%" height="30">卡类型：
		                  	<select id="type"  class="select_1" style="visibility: visible;">
		                  		<option value="">----请选择----</option>
		                  		<option value="0">有价</option>
		                  		<option value="1">非有价</option>
						</td>
		                  	</select> -->
					</tr> 
					<tr>
					   <td height="30"   colspan="4" style="text-align: center;">
                            <input type="button" class="input_button_1" id="searchBtn" value="查询" onClick="queryChannelInfo(1)" />&nbsp;
                            <input type="button" class="input_button_1" id="searchBtn" value="重置" onClick="vreset()" />
                        </td>
					</tr>
				</table>
			</td>
		</tr>		
		<tr>
			<td>
				<table class="search_table">
					<tr height="30px">
						<td width="100%" height="30">
							 <input type="button"  class="input_button_2" id="searchBtn1" value="出库明细" onClick="queryAgentInfo4('1')"/>&nbsp;
						     <input type="button"  class="input_button_2" id="searchBtn2" value="缴费" onClick="paymentConfirm()"/>&nbsp;
						     <input type="button"  class="input_button_2" id="searchBtn3" value="撤销出库" onClick="cancelOutboundApply()"/>&nbsp;
                             <input type="button"  class="input_button_2" id="searchBtn4" value="回传收付" onClick="backPay()"/>&nbsp;
						     <input type="button"  class="input_button_2" id="searchBtn5" value="返回" onClick="returnBack()"/>&nbsp;
						     <!--  
						     <input type="button"  class="input_button_2" id="searchBtn4" value="打印手续费" onClick="printAgentFee()"/>&nbsp;
						     <input type="button"  class="input_button_2" id="searchBtn5" value="打印保费" onClick="printPremamt()"/>&nbsp;
						      -->
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td>
	  			<div id="cardDiv">
	  				<div  style="width:100%;overflow:scroll; overflow-y:hidden" class="table_box " >
						<table id="cardInfoTable" class="content_table_1 " style="width:200%;">
							<thead >
								<tr class="f1">
									<th style="width:60px;">选择</th>
									<th style="width:110px;">收据号</th>
									<th style="width:150px;">卡定义名称</th>
									<th style="width:60px;">卡类型</th>
									<th style="width:60px;">状态</th>
                                    <th style="width:80px;">回传收付状态</th>
									<th style="width:60px;">出库总数</th>
									<th style="width:80px;">每单固定保费</th>
									<th style="width:80px;">总计保费</th>
									<th style="width:60px;">手续费</th>
									<th style="width:70px;">总计手续费</th>
									<th style="width:70px;">手续费费率</th>
									<th style="width:60px;">出库人</th>
									<th style="width:90px;">出库机构</th>
									<th style="width:60px;">业务员</th>
									<th style="width:70px;">代理人</th>
									<th style="width:80px;">代理协议号</th>
									<th style="width:80px;">归属渠道</th>
									<th style="width:80px;">渠道类型</th>
									<th style="width:80px;">业务来源</th>
									<th style="width:70px;">出库日期</th>
								</tr>
							</thead>
							<tbody>
							</tbody>
						</table>
					</div>
					<div id="txCardpageDIV" class="page"></div>
				</div>
			</td>
		</tr>
	</table>
	<!--   	添加模板 DIV 默认隐藏-->
    <div id="agentInfo4Div"  style="display:none;overflow-y:auto; width:700px">
		<div class="table_title_div">
				<table class="table_title" style='width:100%;height: 20px;'>
					<tr>
					<td width="10%"></td>
					<td width="80%" id="interfaceName"></td>
					<td width="10%" align="right"><img src="/manager/images/closedown.gif" alt="关闭"  onclick="closeCurrentDIV('agentInfo4Div')"/></td>
					</tr>
				</table>
	     </div>
	     <br>	
	     <span style=" font-size:16px; font-weight:bold; text-align:left;color:#3876bf; line-height:17px;">出库明细</span>
	    <table class="table_02" id="agentInfo4Table" align="center">
	    	<thead>
				<tr class="f1">
                  <th style="width:65px">序号</th>
                  <th style="width:235px">卡定义名称</th>
                  <th style="width:235px">卡号</th>
                  <th style="width:165px">状态</th>
                </tr>
             </thead>
			 <tbody>
			 </tbody>
		</table>
		<div id="agentInfo4Page"  class="page"></div>		
		<div align="center">
		   <input class="input_button_3" name="" type="button" onclick="closeCurrentDIV('agentInfo4Div')" value="确定">&nbsp;&nbsp;
		</div>
	</div>	
	
	<!--   	添加模板 DIV 默认隐藏-->
    <div id="printDiv" style="display:none;overflow-y:auto; width:210mm;height:450px;">
		<br>
		<br>
		<h2 align="center">激活卡销售保费清单</h2>
		<br>
		<br>
		<table id="table1" class="table_02" style="align:left;width:195mm; border:0;background-color:transparent; ">
			<tr style="border:0;height:18px;">
				<td style="width：400px;text-align:left;border:0">收据号：<span id="commamtIdSpan" style="width:200px;border-bottom:1px solid #000;display: inline-block"></span></td>
				<td style="width：400px;text-align:left;border:0">预收单号：<span id="preSellNoSpan" style="width:200px;border-bottom:1px solid #000;display: inline-block"></span></td>
			</tr>
	    </table>	    
		<table id="tablePremamt" class="table_02" style="height:18px;align:left;width:195mm; border:1.5px solid black;background-color:transparent; " cellspacing="0">
			<tr>
				<td style="text-align:center;width:49mm;border:1px solid black;">卡号</td>
				<td style="text-align:center;width:59mm;border:1px solid black;">卡定义名称</td>
				<td style="text-align:center;width:25mm;border:1px solid black;">张数(张)</td>
				<td style="text-align:center;width:30mmx;border:1px solid black;">保费(元/张)</td>
				<td style="text-align:center;width:32mmx;border:1px solid black;">总保费(元)</td>
			</tr>
			<tr style="height:18px;">
			    <td colspan="2" style="text-align:right;border:1px solid black;">本清单总保费金额:</td>
				<td colspan="3" style="text-align:left;border:1px solid black;">人民币:<span id="dxTotPremAMtSpan"></span>&nbsp;&nbsp;￥<span id="xx2TotPremAMtSpan"></span>元</td>
		    </tr>
		</table>
		<table id="table3" class="table_02" style="align:left;width:195mm; border:0;background-color:transparent; ">
			<tr style="height:18px;">
				<td colspan="2" style="text-align:left;border:0">业务员：&nbsp;<span id="operatorNameSpan" style="width:200px;border-bottom:1px solid #000;display: inline-block"></span></td>
				<td colspan="3" style="text-align:left;border:0">代理人：&nbsp;<span id="agentManSpan" style="width:200px;border-bottom:1px solid #000;display: inline-block"></span></td>
			</tr>
			<tr style="height:18px;border:0">
				<td colspan="5" style="text-align:left;border:0">操作机构：<span id="operatorDeptNoSpan" style="width:300px;border-bottom:1px solid #000;display: inline-block"></span></td>
			</tr>
			<tr style="height:18px;border:0">
				<td colspan="2" style="text-align:left;border:0">操作人：&nbsp;<span id="operatorSpan" style="width:200px;border-bottom:1px solid #000;display: inline-block"></span></td>
				<td colspan="3" style="text-align:left;border:0">打印日期：<span id="printDateSpan" style="width:200px;border-bottom:1px solid #000;display: inline-block"></span></td>
			</tr>
        </table>
        <br>  
		<div id="noprint" align="center">
		   <input class="noprint input_button_3" name="" type="button" onclick="print('printDiv','noprint')" value="打印">&nbsp;&nbsp;
	       <input class="noprint input_button_3" name="" type="button" onclick="closeCurrentDIV('printDiv')" value="取消">
		</div>
	</div>
	<iframe name="print_frame" width="0" height="0" frameborder="0" src="about:blank"></iframe>
    <div id="printFeeDiv" style="display:none;overflow-y:auto; width:210mm;height:450px;">
		<br>
		<br>
		<h2 align="center">激活卡销售手续费清单</h2>
		<br>
		<br>
		<table id="table1" class="table_02" style="align:center;width:198mm; border:0;background-color:transparent;">
			<tr style="border:0;height:18px;">
				<td style="width：450px;text-align:left;border:0">收据号：<span id="commamtIdSpan1" style="width:200px;border-bottom:1px solid #000;display: inline-block"></span></td>
			</tr>
	    </table>	    
		<table id="tableFee" class="table_02" style="align:center;width:198mm; border:1.5px solid black; background-color:transparent;" cellspacing="0">
			<tr>
				<td style="text-align:center;width:48mm;border:1px solid black;">卡号</td>
				<td style="text-align:center;width:50mm;border:1px solid black;">卡定义名称</td>
				<td style="text-align:center;width:25mm;border:1px solid black;">张数(张)</td>
				<td style="text-align:center;width:25mm;border:1px solid black;">保费(元/张)</td>
				<td style="text-align:center;width:25mm;border:1px solid black;">手续费(元/张)</td>
				<td style="text-align:center;width:25mm;border:1px solid black;">总手续费(元)</td>
			</tr>
			<tr style="height:18px;">
			    <td colspan="2" style="text-align:right;border:1px solid black;">本清单总手续费金额:</td>
				<td colspan="4" style="text-align:left;border:1px solid black;">人民币:<span id="dxTotAgentFeeSpan1"></span>&nbsp;&nbsp;￥<span id="xx2TotAgentFeeSpan1"></span>元</td>
		    </tr>
		</table>
		<table id="table3" class="table_02" style="align:center;width:198mm; border:0;background-color:transparent;">
			<tr style="height:18px;">
				<td colspan="2" style="text-align:left;border:0">业务员：&nbsp;<span id="operatorNameSpan1" style="width:200px;border-bottom:1px solid #000;display: inline-block"></span></td>
				<td colspan="4" style="text-align:left;border:0">代理人：&nbsp;<span id="agentManSpan1" style="width:200px;border-bottom:1px solid #000;display: inline-block"></span></td>
			</tr>
			<tr style="height:18px;border:0">
				<td colspan="6" style="text-align:left;border:0">操作机构：<span id="operatorDeptNoSpan1" style="width:280px;border-bottom:1px solid #000;display: inline-block"></span></td>
			</tr>
			<tr style="height:18px;border:0">
				<td colspan="2" style="text-align:left;border:0">操作人：&nbsp;<span id="operatorSpan1" style="width:200px;border-bottom:1px solid #000;display: inline-block" ></span></td>
				<td colspan="4" style="text-align:left;border:0">打印日期：<span id="printDateSpan1" style="width:200px;border-bottom:1px solid #000;display: inline-block"></span>
			</tr>
        </table>
		<div id="noprint1" align="center" class="noprint">
		   <input class="noprint input_button_3" type="button" onclick="print('printFeeDiv','noprint1')" value="打印">&nbsp;&nbsp;
	       <input class="noprint input_button_3" type="button" onclick="closeCurrentDIV('printFeeDiv')" value="取消">
		</div>
	</div>
	
	<div id="Loading" style="display:none" align="center">
		<img src="./images/loading.gif" />
	</div>	
</body>
</html>